import redis,random
from ronglian_sms_sdk import SmsSDK



accId='8aaf070882ede8b30183547171d5127b'
accToken='1766904593f148f0879d2f1625a23521'
appId='8aaf070882ede8b30183547172c01282'


def send_msg(mobile):
    sdk=SmsSDK(appId,accToken,appId)
    tid='1'
    data_=random.randint(10000,99999)
    cls=redis.Redis(host='127.0.0.1',port=6379,db=5)
    cls.set(mobile,data_,ex=300)
    data=(data_)
    resp=sdk.sendMessage(mobile,tid,data)
    print(resp)


